/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rest;

import entity.Message;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;


/**
 *
 * @author student
 */
@Provider
@Produces("pdf/text")//hier komt het contenttype en moet ik nog invullen
public class PDFwriter implements MessageBodyWriter<Message>{
    @Override
    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType){
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    @Override
    public long getSize(Message t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType){
        return -1;
    }
    @Override
    public void writeTo(Message t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException{
         /*try{    
                TransformerFactory transformerfactory = TransformerFactory.newInstance();
            transformer = transformerfactory.newTransformer(xsl);
            FopFactory fopfactory = FopFactory.newInstance();
            Fop fop = fopfactory.newFop(transformtype.getFopoutputvalue(), ost);
            saxresult = new SAXResult(fop.getDefaultHandler());
            transformer.transform(xml,saxresult);
        }catch (TransformerConfigurationException e) {
                System.out.println("fout in xsl tenopzichte van xml");
                e.printStackTrace();
        }finally{
        }*/

    }
}
